package service

import (
	"context"
	v1 "video-api/api/v1"
	"video-api/internal/model/entity"
)

// IUserUserService 接口定义
type IUserService interface {
	GetUserInfoById(context.Context, *v1.UserInfoReq) (*entity.Users, error)
	LoginCallback(context.Context, *v1.LoginReq) (*v1.LoginRes, error)
	Login(ctx context.Context, req *v1.LoginReq) (*v1.LoginRes, error)
	CreateUser(ctx context.Context, req *v1.CreateUserReq) (*v1.LoginRes, error)
	LoginOut(ctx context.Context) (*v1.LoginRes, error)
	AutoPlay(ctx context.Context, req *v1.AutoPlayReq) error
}

var userInstance IUserService

func UserService() IUserService {
	if userInstance == nil {
		panic("localUserService is not initialized")
	}
	return userInstance
}

func RegisterUserService(s IUserService) {
	userInstance = s
}
